/**
 * 
 */
package cn.bblocks.cacheTest.model.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.blinkfox.fenix.jpa.QueryFenix;

//import com.blinkfox.fenix.jpa.QueryFenix;

import cn.bblocks.cacheTest.model.User;


/**
 * @author Administrator
 *
 */

public interface UserMapper extends JpaRepository<User, Integer>{
	

	User findByLoginName(String loginName);
	
	@Query(value = "SELECT * FROM t_user ORDER BY RAND() LIMIT :limit",
			nativeQuery = true)
	List<User> getRandomUsers(@Param("limit")Integer limit);
	
	
	@QueryFenix(value="UserMapper.queryBy",nativeQuery=true)
	List<User> queryBy(@Param("loginName")String loginName
			,@Param("name")String name
			,@Param("status")Integer status);
}
